Rules for integrands of the form (((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m)

1.  ∫((Cos[e+f x])^p) (((a+b Sin[e+f x]))^m)dx  when ((p-1)/2)∈ℤ

1:  ∫((Cos[e+f x])^p)(((a+b Sin[e+f x]))^m)dx  when ((p-1)/2)∈ℤ ∧ (a^2)-(b^2)==0

Derivation: Integration by substitution

Basis: If ((p-1)/2)∈ℤ ∧ (a^2)-(b^2)==0, then ((Cos[e+f x])^p)(((a+b Sin[e+f x]))^m)==(1/((b^p) f))Subst[(((a+x))^(m+((p-1)/2)))(((a-x))^((p-1)/2)),x,b Sin[e+f x]](∂_x)(b Sin[e+f x])

Rule: If ((p-1)/2)∈ℤ ∧ (a^2)-(b^2)==0, then

∫((Cos[e+f x])^p)(((a+b Sin[e+f x]))^m)dx  ⟶  (1/((b^p) f))Subst[∫(((a+x))^(m+((p-1)/2)))(((a-x))^((p-1)/2))dx,x,b Sin[e+f x]]

Program code:

Int[cos[e_.+f_.*x_]^p_.*(a_+b_.*sin[e_.+f_.*x_])^m_.,x_Symbol] :=
  1/(b^p*f)*Subst[Int[(a+x)^(m+(p-1)/2)*(a-x)^((p-1)/2),x],x,b*Sin[e+f*x]] /;
FreeQ[{a,b,e,f,m},x] && IntegerQ[(p-1)/2] && EqQ[a^2-b^2,0] && (GeQ[p,-1] || Not[IntegerQ[m+1/2]])

2:  ∫((Cos[e+f x])^p)(((a+b Sin[e+f x]))^m)dx  when ((p-1)/2)∈ℤ ∧ (a^2)-(b^2)≠0

Derivation: Integration by substitution

Basis: If ((p-1)/2)∈ℤ, then ((Cos[e+f x])^p)F[b Sin[e+f x]]==(1/((b^p) f))Subst[F[x]((((b^2)-(x^2)))^((p-1)/2)),x,b Sin[e+f x]](∂_x)(b Sin[e+f x])

Rule: If ((p-1)/2)∈ℤ ∧ (a^2)-(b^2)≠0, then

∫((Cos[e+f x])^p)(((a+b Sin[e+f x]))^m)dx  ⟶  (1/((b^p) f))Subst[∫(((a+x))^m)((((b^2)-(x^2)))^((p-1)/2))dx,x,b Sin[e+f x]]

Program code:

Int[cos[e_.+f_.*x_]^p_.*(a_+b_.*sin[e_.+f_.*x_])^m_.,x_Symbol] :=
  1/(b^p*f)*Subst[Int[(a+x)^m*(b^2-x^2)^((p-1)/2),x],x,b*Sin[e+f*x]] /;
FreeQ[{a,b,e,f,m},x] && IntegerQ[(p-1)/2] && NeQ[a^2-b^2,0]

2:  ∫(((g Cos[e+f x]))^p) (a+b Sin[e+f x])dx

Derivation: Nondegenerate sine recurrence 1b with c->0,d->1,A->0,B->a,C->b,m->0,n->-1

Rule:

∫(((g Cos[e+f x]))^p)(a+b Sin[e+f x])dx  ⟶  -((b (((g Cos[e+f x]))^(p+1)))/(f g(p+1)))+a∫(((g Cos[e+f x]))^p)dx

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(a_+b_.*sin[e_.+f_.*x_]),x_Symbol] :=
  -b*(g*Cos[e+f*x])^(p+1)/(f*g*(p+1)) + a*Int[(g*Cos[e+f*x])^p,x] /;
FreeQ[{a,b,e,f,g,p},x] && (IntegerQ[2*p] || NeQ[a^2-b^2,0])

3.  ∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m)dx  when (a^2)-(b^2)==0

1:  ∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m)dx  when (a^2)-(b^2)==0 ∧ m∈ℤ ∧ p<-1 ∧ 2 m+p≥0

Derivation: Algebraic simplification

Basis: If  (a^2)-(b^2)==0 ∧ m∈ℤ, then (((a+b Sin[z]))^m)==(((a^(2 m)) ((Cos[z])^(2 m)))/(((a-b Sin[z]))^m))

Note: This rule removes removable singularities from the integrand and hence from the resulting antiderivatives.

Rule: If  (a^2)-(b^2)==0 ∧ m∈ℤ ∧ p<-1 ∧ 2 m+p≥0, then

∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m)dx  ⟶  ((a^(2 m))/(g^(2 m))) ∫((((g Cos[e+f x]))^(2 m+p))/(((a-b Sin[e+f x]))^m))dx

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(a_+b_.*sin[e_.+f_.*x_])^m_,x_Symbol] :=
  (a/g)^(2*m)*Int[(g*Cos[e+f*x])^(2*m+p)/(a-b*Sin[e+f*x])^m,x] /;
FreeQ[{a,b,e,f,g},x] && EqQ[a^2-b^2,0] && IntegerQ[m] && LtQ[p,-1] && GeQ[2*m+p,0]

2.  ∫(((g Cos[e+f x]))^p)(((a+b Sin[e+f x]))^m)dx  when (a^2)-(b^2)==0 ∧ m+p∈(SuperMinus[ℤ])

1:  ∫(((g Cos[e+f x]))^p)(((a+b Sin[e+f x]))^m)dx  when (a^2)-(b^2)==0 ∧ m+p+1==0 ∧ p∉(SuperMinus[ℤ])

Derivation: Symmetric cosine/sine recurrence 1b with m->-m-1

Derivation: Symmetric cosine/sine recurrence 2c with m->-m-1

Rule: If  (a^2)-(b^2)==0 ∧ m+p+1==0 ∧ p∉(SuperMinus[ℤ]), then

∫(((g Cos[e+f x]))^p)(((a+b Sin[e+f x]))^m)dx  ⟶  ((b (((g Cos[e+f x]))^(p+1)) (((a+b Sin[e+f x]))^m))/(a f g m))

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(a_+b_.*sin[e_.+f_.*x_])^m_,x_Symbol] :=
  b*(g*Cos[e+f*x])^(p+1)*(a+b*Sin[e+f*x])^m/(a*f*g*m) /;
FreeQ[{a,b,e,f,g,m,p},x] && EqQ[a^2-b^2,0] && EqQ[Simplify[m+p+1],0] && Not[ILtQ[p,0]]

2:  ∫(((g Cos[e+f x]))^p)(((a+b Sin[e+f x]))^m)dx  when (a^2)-(b^2)==0 ∧ m+p+1∈(SuperMinus[ℤ])∧ 2 m+p+1≠0

Derivation: Symmetric cosine/sine recurrence 2c

Rule: If  (a^2)-(b^2)==0 ∧ m+p+1∈(SuperMinus[ℤ])∧ 2 m+p+1≠0, then

∫(((g Cos[e+f x]))^p)(((a+b Sin[e+f x]))^m)dx  ⟶  
((b (((g Cos[e+f x]))^(p+1)) (((a+b Sin[e+f x]))^m))/(a f g(2 m+p+1)))+((m+p+1)/(a (2 m+p+1)))∫(((g Cos[e+f x]))^p)(((a+b Sin[e+f x]))^(m+1))dx

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(a_+b_.*sin[e_.+f_.*x_])^m_,x_Symbol] :=
  b*(g*Cos[e+f*x])^(p+1)*(a+b*Sin[e+f*x])^m/(a*f*g*Simplify[2*m+p+1]) + 
  Simplify[m+p+1]/(a*Simplify[2*m+p+1])*Int[(g*Cos[e+f*x])^p*(a+b*Sin[e+f*x])^(m+1),x] /;
FreeQ[{a,b,e,f,g,m,p},x] && EqQ[a^2-b^2,0] && ILtQ[Simplify[m+p+1],0] && NeQ[2*m+p+1,0] && Not[IGtQ[m,0]]

3.  ∫(((g Cos[e+f x]))^p)(((a+b Sin[e+f x]))^m)dx  when (a^2)-(b^2)==0 ∧ ((2 m+p+1)/2)∈(SuperPlus[ℤ])

1:  ∫(((g Cos[e+f x]))^p)(((a+b Sin[e+f x]))^m)dx  when (a^2)-(b^2)==0 ∧ 2 m+p-1==0 ∧ m≠1

Derivation: Symmetric cosine/sine recurrence 1a with m->-2m+1

Derivation: Symmetric cosine/sine recurrence 1c with m->-2m+1

Rule: If  (a^2)-(b^2)==0 ∧ 2 m+p-1==0 ∧ m≠1, then

∫(((g Cos[e+f x]))^p)(((a+b Sin[e+f x]))^m)dx  ⟶  ((b (((g Cos[e+f x]))^(p+1)) (((a+b Sin[e+f x]))^(m-1)))/(f g(m-1)))

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(a_+b_.*sin[e_.+f_.*x_])^m_,x_Symbol] :=
  b*(g*Cos[e+f*x])^(p+1)*(a+b*Sin[e+f*x])^(m-1)/(f*g*(m-1)) /;
FreeQ[{a,b,e,f,g,m,p},x] && EqQ[a^2-b^2,0] && EqQ[2*m+p-1,0] && NeQ[m,1]

2:  ∫(((g Cos[e+f x]))^p)(((a+b Sin[e+f x]))^m)dx  when (a^2)-(b^2)==0 ∧ ((2 m+p-1)/2)∈(SuperPlus[ℤ])∧ m+p≠0

Derivation: Symmetric cosine/sine recurrence 1c

Rule: If  (a^2)-(b^2)==0 ∧ ((2 m+p-1)/2)∈(SuperPlus[ℤ])∧ m+p≠0, then

∫(((g Cos[e+f x]))^p)(((a+b Sin[e+f x]))^m)dx  ⟶  
-((b (((g Cos[e+f x]))^(p+1)) (((a+b Sin[e+f x]))^(m-1)))/(f g(m+p)))+((a (2 m+p-1))/(m+p))∫(((g Cos[e+f x]))^p)(((a+b Sin[e+f x]))^(m-1))dx

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(a_+b_.*sin[e_.+f_.*x_])^m_,x_Symbol] :=
  -b*(g*Cos[e+f*x])^(p+1)*(a+b*Sin[e+f*x])^(m-1)/(f*g*(m+p)) + 
  a*(2*m+p-1)/(m+p)*Int[(g*Cos[e+f*x])^p*(a+b*Sin[e+f*x])^(m-1),x] /;
FreeQ[{a,b,e,f,g,m,p},x] && EqQ[a^2-b^2,0] && IGtQ[Simplify[(2*m+p-1)/2],0] && NeQ[m+p,0]

4.  ∫(((g Cos[e+f x]))^p)(((a+b Sin[e+f x]))^m)dx  when (a^2)-(b^2)==0 ∧ m>0

1.  ∫(((g Cos[e+f x]))^p)(((a+b Sin[e+f x]))^m)dx  when (a^2)-(b^2)==0 ∧ m>0 ∧ p<-1

1:  ∫(((g Cos[e+f x]))^p)(((a+b Sin[e+f x]))^m)dx  when (a^2)-(b^2)==0 ∧ m>0 ∧ p≤-2m

Derivation: Symmetric cosine/sine recurrence 1b

Rule: If  (a^2)-(b^2)==0 ∧ m>0 ∧ p≤-2m, then

∫(((g Cos[e+f x]))^p)(((a+b Sin[e+f x]))^m)dx  ⟶  
-((b (((g Cos[e+f x]))^(p+1)) (((a+b Sin[e+f x]))^m))/(a f g(p+1)))+((a (m+p+1))/((g^2)(p+1)))∫(((g Cos[e+f x]))^(p+2))(((a+b Sin[e+f x]))^(m-1))dx

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(a_+b_.*sin[e_.+f_.*x_])^m_,x_Symbol] :=
  -b*(g*Cos[e+f*x])^(p+1)*(a+b*Sin[e+f*x])^m/(a*f*g*(p+1)) + 
  a*(m+p+1)/(g^2*(p+1))*Int[(g*Cos[e+f*x])^(p+2)*(a+b*Sin[e+f*x])^(m-1),x] /;
FreeQ[{a,b,e,f,g},x] && EqQ[a^2-b^2,0] && GtQ[m,0] && LeQ[p,-2*m] && IntegersQ[m+1/2,2*p]

2:  ∫(((g Cos[e+f x]))^p)(((a+b Sin[e+f x]))^m)dx  when (a^2)-(b^2)==0 ∧ m>1 ∧ p<-1

Derivation: Symmetric cosine/sine recurrence 1a

Rule: If  (a^2)-(b^2)==0 ∧ m>1 ∧ p<-1, then

∫(((g Cos[e+f x]))^p)(((a+b Sin[e+f x]))^m)dx  ⟶  
-((2b (((g Cos[e+f x]))^(p+1)) (((a+b Sin[e+f x]))^(m-1)))/(f g(p+1)))+(((b^2) (2 m+p-1))/((g^2)(p+1)))∫(((g Cos[e+f x]))^(p+2))(((a+b Sin[e+f x]))^(m-2))dx

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(a_+b_.*sin[e_.+f_.*x_])^m_,x_Symbol] :=
  -2*b*(g*Cos[e+f*x])^(p+1)*(a+b*Sin[e+f*x])^(m-1)/(f*g*(p+1)) + 
  b^2*(2*m+p-1)/(g^2*(p+1))*Int[(g*Cos[e+f*x])^(p+2)*(a+b*Sin[e+f*x])^(m-2),x] /;
FreeQ[{a,b,e,f,g},x] && EqQ[a^2-b^2,0] && GtQ[m,1] && LtQ[p,-1] && IntegersQ[2*m,2*p]

2.  ∫(((g Cos[e+f x]))^p)(((a+b Sin[e+f x]))^m)dx  when (a^2)-(b^2)==0 ∧ m>0 ∧ p≮-1

1:  ∫((Sqrt[a+b Sin[e+f x]])/(Sqrt[g Cos[e+f x]]))dx  when (a^2)-(b^2)==0

Derivation: Piecewise constant extraction and algebraic expansion

Basis: If  (a^2)-(b^2)==0, then (∂_x)(((Sqrt[1+Cos[e+f x]])(Sqrt[a+b Sin[e+f x]]))/(a+a Cos[e+f x]+b Sin[e+f x]))==0

Rule: If  (a^2)-(b^2)==0, then

∫((Sqrt[a+b Sin[e+f x]])/(Sqrt[g Cos[e+f x]]))dx  ⟶  (((Sqrt[1+Cos[e+f x]])(Sqrt[a+b Sin[e+f x]]))/(a+a Cos[e+f x]+b Sin[e+f x]))∫((a+a Cos[e+f x]+b Sin[e+f x])/((Sqrt[g Cos[e+f x]]) (Sqrt[1+Cos[e+f x]])))dx

  ⟶  ((a(Sqrt[1+Cos[e+f x]])(Sqrt[a+b Sin[e+f x]]))/(a+a Cos[e+f x]+b Sin[e+f x]))∫((Sqrt[1+Cos[e+f x]])/(Sqrt[g Cos[e+f x]]))dx+((b(Sqrt[1+Cos[e+f x]])(Sqrt[a+b Sin[e+f x]]))/(a+a Cos[e+f x]+b Sin[e+f x]))∫((Sin[e+f x])/((Sqrt[g Cos[e+f x]]) (Sqrt[1+Cos[e+f x]])))dx

Program code:

Int[Sqrt[a_+b_.*sin[e_.+f_.*x_]]/Sqrt[g_.*cos[e_.+f_.*x_]],x_Symbol] :=
  a*Sqrt[1+Cos[e+f*x]]*Sqrt[a+b*Sin[e+f*x]]/(a+a*Cos[e+f*x]+b*Sin[e+f*x])*Int[Sqrt[1+Cos[e+f*x]]/Sqrt[g*Cos[e+f*x]],x] + 
  b*Sqrt[1+Cos[e+f*x]]*Sqrt[a+b*Sin[e+f*x]]/(a+a*Cos[e+f*x]+b*Sin[e+f*x])*Int[Sin[e+f*x]/(Sqrt[g*Cos[e+f*x]]*Sqrt[1+Cos[e+f*x]]),x] /;
FreeQ[{a,b,e,f,g},x] && EqQ[a^2-b^2,0]

2:  ∫(((g Cos[e+f x]))^p)(((a+b Sin[e+f x]))^m)dx  when (a^2)-(b^2)==0 ∧ m>0 ∧ m+p≠0

Derivation: Symmetric cosine/sine recurrence 1c

Rule: If  (a^2)-(b^2)==0 ∧ m>0 ∧ m+p≠0, then

∫(((g Cos[e+f x]))^p)(((a+b Sin[e+f x]))^m)dx  ⟶  
-((b (((g Cos[e+f x]))^(p+1)) (((a+b Sin[e+f x]))^(m-1)))/(f g(m+p)))+((a (2 m+p-1))/(m+p))∫(((g Cos[e+f x]))^p)(((a+b Sin[e+f x]))^(m-1))dx

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(a_+b_.*sin[e_.+f_.*x_])^m_,x_Symbol] :=
  -b*(g*Cos[e+f*x])^(p+1)*(a+b*Sin[e+f*x])^(m-1)/(f*g*(m+p)) + 
  a*(2*m+p-1)/(m+p)*Int[(g*Cos[e+f*x])^p*(a+b*Sin[e+f*x])^(m-1),x] /;
FreeQ[{a,b,e,f,g,m,p},x] && EqQ[a^2-b^2,0] && GtQ[m,0] && NeQ[m+p,0] && IntegersQ[2*m,2*p]

5.  ∫(((g Cos[e+f x]))^p)(((a+b Sin[e+f x]))^m)dx  when (a^2)-(b^2)==0 ∧ m<-1

1.  ∫(((g Cos[e+f x]))^p)(((a+b Sin[e+f x]))^m)dx  when (a^2)-(b^2)==0 ∧ m<-1 ∧ p>1

1:  ∫(((g Cos[e+f x]))^p)(((a+b Sin[e+f x]))^m)dx  when (a^2)-(b^2)==0 ∧ m<-1 ∧ p>1 ∧ (m>-2 ∨ p+2m+1==0)

Derivation: Symmetric cosine/sine recurrence 2a and 1c

Rule: If  (a^2)-(b^2)==0 ∧ m<-1 ∧ p>1 ∧ (m>-2 ∨ p+2m+1==0), then

∫(((g Cos[e+f x]))^p)(((a+b Sin[e+f x]))^m)dx  ⟶  
((g (((g Cos[e+f x]))^(p-1)) (((a+b Sin[e+f x]))^(m+1)))/(b f (m+p)))+(((g^2) (p-1))/(a (m+p)))∫(((g Cos[e+f x]))^(p-2))(((a+b Sin[e+f x]))^(m+1))dx

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(a_+b_.*sin[e_.+f_.*x_])^m_,x_Symbol] :=
  g*(g*Cos[e+f*x])^(p-1)*(a+b*Sin[e+f*x])^(m+1)/(b*f*(m+p)) + 
  g^2*(p-1)/(a*(m+p))*Int[(g*Cos[e+f*x])^(p-2)*(a+b*Sin[e+f*x])^(m+1),x] /;
FreeQ[{a,b,e,f,g},x] && EqQ[a^2-b^2,0] && LtQ[m,-1] && GtQ[p,1] && (GtQ[m,-2] || EqQ[2*m+p+1,0] || EqQ[m,-2] && IntegerQ[p]) && 
  NeQ[m+p,0] && IntegersQ[2*m,2*p]

2:  ∫(((g Cos[e+f x]))^p)(((a+b Sin[e+f x]))^m)dx  when (a^2)-(b^2)==0 ∧ m≤-2 ∧ p>1 ∧ 2 m+p+1≠0

Derivation: Symmetric cosine/sine recurrence 2a

Rule: If  (a^2)-(b^2)==0 ∧ m≤-2 ∧ p>1 ∧ 2 m+p+1≠0, then

∫(((g Cos[e+f x]))^p)(((a+b Sin[e+f x]))^m)dx  ⟶  
((2g (((g Cos[e+f x]))^(p-1)) (((a+b Sin[e+f x]))^(m+1)))/(b f(2 m+p+1)))+(((g^2)(p-1))/((b^2) (2 m+p+1)))∫(((g Cos[e+f x]))^(p-2))(((a+b Sin[e+f x]))^(m+2))dx

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(a_+b_.*sin[e_.+f_.*x_])^m_,x_Symbol] :=
  2*g*(g*Cos[e+f*x])^(p-1)*(a+b*Sin[e+f*x])^(m+1)/(b*f*(2*m+p+1)) + 
  g^2*(p-1)/(b^2*(2*m+p+1))*Int[(g*Cos[e+f*x])^(p-2)*(a+b*Sin[e+f*x])^(m+2),x] /;
FreeQ[{a,b,e,f,g},x] && EqQ[a^2-b^2,0] && LeQ[m,-2] && GtQ[p,1] && NeQ[2*m+p+1,0] && Not[ILtQ[m+p+1,0]] && IntegersQ[2*m,2*p]

2:  ∫(((g Cos[e+f x]))^p)(((a+b Sin[e+f x]))^m)dx  when (a^2)-(b^2)==0 ∧ m<-1 ∧ 2 m+p+1≠0

Derivation: Symmetric cosine/sine recurrence 2c

Rule: If  (a^2)-(b^2)==0 ∧ m<-1 ∧ 2 m+p+1≠0, then

∫(((g Cos[e+f x]))^p)(((a+b Sin[e+f x]))^m)dx  ⟶  
((b (((g Cos[e+f x]))^(p+1)) (((a+b Sin[e+f x]))^m))/(a f g(2 m+p+1)))+((m+p+1)/(a (2 m+p+1)))∫(((g Cos[e+f x]))^p)(((a+b Sin[e+f x]))^(m+1))dx

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(a_+b_.*sin[e_.+f_.*x_])^m_,x_Symbol] :=
  b*(g*Cos[e+f*x])^(p+1)*(a+b*Sin[e+f*x])^m/(a*f*g*(2*m+p+1)) + 
  (m+p+1)/(a*(2*m+p+1))*Int[(g*Cos[e+f*x])^p*(a+b*Sin[e+f*x])^(m+1),x] /;
FreeQ[{a,b,e,f,g,m,p},x] && EqQ[a^2-b^2,0] && LtQ[m,-1] && NeQ[2*m+p+1,0] && IntegersQ[2*m,2*p]

6.  ∫((((g Cos[e+f x]))^p)/(a+b Sin[e+f x]))dx  when (a^2)-(b^2)==0

1:  ∫((((g Cos[e+f x]))^p)/(a+b Sin[e+f x]))dx  when (a^2)-(b^2)==0 ∧ p>1

Derivation: Symmetric cosine/sine recurrence 2a and 1c

Rule: If  (a^2)-(b^2)==0 ∧ p>1, then

∫((((g Cos[e+f x]))^p)/(a+b Sin[e+f x]))dx  ⟶  ((g (((g Cos[e+f x]))^(p-1)))/(b f (p-1)))+((g^2)/a)∫(((g Cos[e+f x]))^(p-2))dx

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_/(a_+b_.*sin[e_.+f_.*x_]),x_Symbol] :=
  g*(g*Cos[e+f*x])^(p-1)/(b*f*(p-1)) + g^2/a*Int[(g*Cos[e+f*x])^(p-2),x] /;
FreeQ[{a,b,e,f,g},x] && EqQ[a^2-b^2,0] && GtQ[p,1] && IntegerQ[2*p]

2:  ∫((((g Cos[e+f x]))^p)/(a+b Sin[e+f x]))dx  when (a^2)-(b^2)==0 ∧ p≰1

Derivation: Symmetric cosine/sine recurrence 2c

Rule: If  (a^2)-(b^2)==0 ∧ p<0, then

∫((((g Cos[e+f x]))^p)/(a+b Sin[e+f x]))dx  ⟶  ((b (((g Cos[e+f x]))^(p+1)))/(a f g(p-1)(a+b Sin[e+f x])))+(p/(a (p-1)))∫(((g Cos[e+f x]))^p)dx

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_/(a_+b_.*sin[e_.+f_.*x_]),x_Symbol] :=
  b*(g*Cos[e+f*x])^(p+1)/(a*f*g*(p-1)*(a+b*Sin[e+f*x])) + 
  p/(a*(p-1))*Int[(g*Cos[e+f*x])^p,x] /;
FreeQ[{a,b,e,f,g,p},x] && EqQ[a^2-b^2,0] && Not[GeQ[p,1]] && IntegerQ[2*p]

7.  ∫((((g Cos[e+f x]))^p)/(Sqrt[a+b Sin[e+f x]]))dx  when (a^2)-(b^2)==0

1.  ∫((((g Cos[e+f x]))^p)/(Sqrt[a+b Sin[e+f x]]))dx  when (a^2)-(b^2)==0 ∧ p>0

1:  ∫((Sqrt[g Cos[e+f x]])/(Sqrt[a+b Sin[e+f x]]))dx  when (a^2)-(b^2)==0

Derivation: Piecewise constant extraction and algebraic expansion

Basis: If  (a^2)-(b^2)==0, then (∂_x)(((Sqrt[1+Cos[e+f x]]) (Sqrt[a+b Sin[e+f x]]))/(a+a Cos[e+f x]+b Sin[e+f x]))==0

Rule: If  (a^2)-(b^2)==0, then

∫((Sqrt[g Cos[e+f x]])/(Sqrt[a+b Sin[e+f x]]))dx  ⟶  ((g (Sqrt[1+Cos[e+f x]])(Sqrt[a+b Sin[e+f x]]))/(a(a+a Cos[e+f x]+b Sin[e+f x])))∫((a+a Cos[e+f x]-b Sin[e+f x])/((Sqrt[g Cos[e+f x]]) (Sqrt[1+Cos[e+f x]])))dx

  ⟶  ((g (Sqrt[1+Cos[e+f x]])(Sqrt[a+b Sin[e+f x]]))/(a+a Cos[e+f x]+b Sin[e+f x]))∫((Sqrt[1+Cos[e+f x]])/(Sqrt[g Cos[e+f x]]))dx-((g (Sqrt[1+Cos[e+f x]])(Sqrt[a+b Sin[e+f x]]))/(b+b Cos[e+f x]+a Sin[e+f x]))∫((Sin[e+f x])/((Sqrt[g Cos[e+f x]]) (Sqrt[1+Cos[e+f x]])))dx

Program code:

Int[Sqrt[g_.*cos[e_.+f_.*x_]]/Sqrt[a_+b_.*sin[e_.+f_.*x_]],x_Symbol] :=
  g*Sqrt[1+Cos[e+f*x]]*Sqrt[a+b*Sin[e+f*x]]/(a+a*Cos[e+f*x]+b*Sin[e+f*x])*Int[Sqrt[1+Cos[e+f*x]]/Sqrt[g*Cos[e+f*x]],x] - 
  g*Sqrt[1+Cos[e+f*x]]*Sqrt[a+b*Sin[e+f*x]]/(b+b*Cos[e+f*x]+a*Sin[e+f*x])*Int[Sin[e+f*x]/(Sqrt[g*Cos[e+f*x]]*Sqrt[1+Cos[e+f*x]]),x] /;
FreeQ[{a,b,e,f,g},x] && EqQ[a^2-b^2,0]

2:  ∫((((g Cos[e+f x]))^(3/2))/(Sqrt[a+b Sin[e+f x]]))dx  when (a^2)-(b^2)==0

Derivation: Symmetric cosine/sine recurrence 2a and 1c

Rule: If  (a^2)-(b^2)==0, then

∫((((g Cos[e+f x]))^(3/2))/(Sqrt[a+b Sin[e+f x]]))dx  ⟶  ((g (Sqrt[g Cos[e+f x]]) (Sqrt[a+b Sin[e+f x]]))/(b f))+((g^2)/(2 a))∫((Sqrt[a+b Sin[e+f x]])/(Sqrt[g Cos[e+f x]]))dx

Program code:

Int[(g_.*cos[e_.+f_.*x_])^(3/2)/Sqrt[a_+b_.*sin[e_.+f_.*x_]],x_Symbol] :=
  g*Sqrt[g*Cos[e+f*x]]*Sqrt[a+b*Sin[e+f*x]]/(b*f) + 
  g^2/(2*a)*Int[Sqrt[a+b*Sin[e+f*x]]/Sqrt[g*Cos[e+f*x]],x] /;
FreeQ[{a,b,e,f,g},x] && EqQ[a^2-b^2,0]

3:  ∫((((g Cos[e+f x]))^p)/(Sqrt[a+b Sin[e+f x]]))dx  when (a^2)-(b^2)==0 ∧ p>2

Derivation: Symmetric cosine/sine recurrence 1c with n->-(1/2)

Rule: If  (a^2)-(b^2)==0 ∧ p>2, then

∫((((g Cos[e+f x]))^p)/(Sqrt[a+b Sin[e+f x]]))dx  ⟶  -((2 b (((g Cos[e+f x]))^(p+1)))/(f g(2 p-1) (((a+b Sin[e+f x]))^(3/2))))+((2 a (p-2))/(2 p-1))∫((((g Cos[e+f x]))^p)/(((a+b Sin[e+f x]))^(3/2)))dx

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_/Sqrt[a_+b_.*sin[e_.+f_.*x_]],x_Symbol] :=
  -2*b*(g*Cos[e+f*x])^(p+1)/(f*g*(2*p-1)*(a+b*Sin[e+f*x])^(3/2)) + 
  2*a*(p-2)/(2*p-1)*Int[(g*Cos[e+f*x])^p/(a+b*Sin[e+f*x])^(3/2),x] /;
FreeQ[{a,b,e,f,g},x] && EqQ[a^2-b^2,0] && GtQ[p,2] && IntegerQ[2*p]

2:  ∫((((g Cos[e+f x]))^p)/(Sqrt[a+b Sin[e+f x]]))dx  when (a^2)-(b^2)==0 ∧ p<-1

Derivation: Symmetric cosine/sine recurrence 1b with n->-(1/2)

Rule: If  (a^2)-(b^2)==0 ∧ p<-1, then

∫((((g Cos[e+f x]))^p)/(Sqrt[a+b Sin[e+f x]]))dx  ⟶  -((b (((g Cos[e+f x]))^(p+1)))/(a f g(p+1)(Sqrt[a+b Sin[e+f x]])))+((a (2p+1))/(2(g^2)(p+1)))∫((((g Cos[e+f x]))^(p+2))/(((a+b Sin[e+f x]))^(3/2)))dx

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_/Sqrt[a_+b_.*sin[e_.+f_.*x_]],x_Symbol] :=
  -b*(g*Cos[e+f*x])^(p+1)/(a*f*g*(p+1)*Sqrt[a+b*Sin[e+f*x]]) + 
  a*(2*p+1)/(2*g^2*(p+1))*Int[(g*Cos[e+f*x])^(p+2)/(a+b*Sin[e+f*x])^(3/2),x] /;
FreeQ[{a,b,e,f,g},x] && EqQ[a^2-b^2,0] && LtQ[p,-1] && IntegerQ[2*p]

8.  ∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m)dx  when (a^2)-(b^2)==0

1:  ∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m)dx  when  (a^2)-(b^2)==0 ∧ m∈ℤ

Derivation: Piecewise constant extraction and integration by substitution

Basis: If  (a^2)-(b^2)==0, then (∂_x)((((g Cos[e+f x]))^(p+1))/((((1+Sin[e+f x]))^((p+1)/2)) (((1-Sin[e+f x]))^((p+1)/2))))==0

Basis: If  (a^2)-(b^2)==0, then ((((g Cos[e+f x]))^(p+1))/(g (((1+Sin[e+f x]))^((p+1)/2)) (((1-Sin[e+f x]))^((p+1)/2))))((Cos[e+f x] (((1+(b/a) Sin[e+f x]))^((p-1)/2))(((1-(b/a) Sin[e+f x]))^((p-1)/2)))/(((g Cos[e+f x]))^p))==1

Basis: Cos[e+f x]==(1/f)(∂_x)Sin[e+f x]

Rule: If  (a^2)-(b^2)==0 ∧ m∈ℤ, then

∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m)dx  ⟶  (a^m) ∫(((g Cos[e+f x]))^p) (((1+(b/a) Sin[e+f x]))^m)dx  ⟶  

(((a^m) (((g Cos[e+f x]))^(p+1)))/(g (((1+Sin[e+f x]))^((p+1)/2)) (((1-Sin[e+f x]))^((p+1)/2))))∫Cos[e+f x] (((1+(b/a) Sin[e+f x]))^(m+((p-1)/2)))(((1-(b/a) Sin[e+f x]))^((p-1)/2))dx  ⟶  

(((a^m) (((g Cos[e+f x]))^(p+1)))/(f g (((1+Sin[e+f x]))^((p+1)/2)) (((1-Sin[e+f x]))^((p+1)/2))))Subst[∫(((1+(b/a) x))^(m+((p-1)/2))) (((1-(b/a) x))^((p-1)/2))dx,x,Sin[e+f x]]

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(a_+b_.*sin[e_.+f_.*x_])^m_.,x_Symbol] :=
  a^m*(g*Cos[e+f*x])^(p+1)/(f*g*(1+Sin[e+f*x])^((p+1)/2)*(1-Sin[e+f*x])^((p+1)/2))*
    Subst[Int[(1+b/a*x)^(m+(p-1)/2)*(1-b/a*x)^((p-1)/2),x],x,Sin[e+f*x]] /;
FreeQ[{a,b,e,f,g,p},x] && EqQ[a^2-b^2,0] && IntegerQ[m]

2:  ∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m)dx  when  (a^2)-(b^2)==0 ∧ m∉ℤ

Derivation: Piecewise constant extraction and integration by substitution

Basis: If  (a^2)-(b^2)==0, then (∂_x)((((g Cos[e+f x]))^(p+1))/((((a+b Sin[e+f x]))^((p+1)/2)) (((a-b Sin[e+f x]))^((p+1)/2))))==0

Basis: If  (a^2)-(b^2)==0, then (((a^2) (((g Cos[e+f x]))^(p+1)))/(g (((a+b Sin[e+f x]))^((p+1)/2)) (((a-b Sin[e+f x]))^((p+1)/2))))((Cos[e+f x] (((a+b Sin[e+f x]))^((p-1)/2)) (((a-b Sin[e+f x]))^((p-1)/2)))/(((g Cos[e+f x]))^p))==1

Basis: Cos[e+f x]==(1/f)(∂_x)Sin[e+f x]

Rule: If  (a^2)-(b^2)==0 ∧ m∉ℤ, then

∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m)dx  ⟶  

(((a^2) (((g Cos[e+f x]))^(p+1)))/(g (((a+b Sin[e+f x]))^((p+1)/2)) (((a-b Sin[e+f x]))^((p+1)/2))))∫Cos[e+f x] (((a+b Sin[e+f x]))^(m+((p-1)/2)))(((a-b Sin[e+f x]))^((p-1)/2))dx  ⟶  

(((a^2) (((g Cos[e+f x]))^(p+1)))/(f g (((a+b Sin[e+f x]))^((p+1)/2)) (((a-b Sin[e+f x]))^((p+1)/2))))Subst[∫(((a+b x))^(m+((p-1)/2))) (((a-b x))^((p-1)/2))dx,x,Sin[e+f x]]

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(a_+b_.*sin[e_.+f_.*x_])^m_.,x_Symbol] :=
  a^2*(g*Cos[e+f*x])^(p+1)/(f*g*(a+b*Sin[e+f*x])^((p+1)/2)*(a-b*Sin[e+f*x])^((p+1)/2))*
    Subst[Int[(a+b*x)^(m+(p-1)/2)*(a-b*x)^((p-1)/2),x],x,Sin[e+f*x]] /;
FreeQ[{a,b,e,f,g,m,p},x] && EqQ[a^2-b^2,0] && Not[IntegerQ[m]]

4.  ∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m)dx  when (a^2)-(b^2)≠0

1.  ∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m)dx  when  (a^2)-(b^2)≠0 ∧ m>0

1.  ∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m)dx  when  (a^2)-(b^2)≠0 ∧ m>0 ∧ p<-1

1:  ∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m)dx  when (a^2)-(b^2)≠0 ∧ 0<m<1 ∧ p<-1

Derivation: Nondegenerate sine recurrence 3a with c->1,d->0,A->1,B->0,C->0

Derivation: Nondegenerate sine recurrence 3b with c->0,d->1,A->0,B->a,C->b,m->m-1,n->-1

Derivation: Nondegenerate sine recurrence 3a with c->0,d->1,A->0,B->1,C->0,n->-1

Rule: If  (a^2)-(b^2)≠0 ∧ 0<m<1 ∧ p<-1, then

∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m)dx  ⟶  
-(((((g Cos[e+f x]))^(p+1))(((a+b Sin[e+f x]))^m)Sin[e+f x])/(f g (p+1)))+
(1/((g^2) (p+1)))∫(((g Cos[e+f x]))^(p+2)) (((a+b Sin[e+f x]))^(m-1))(a(p+2)+b (m+p+2) Sin[e+f x])dx

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(a_+b_.*sin[e_.+f_.*x_])^m_,x_Symbol] :=
  -(g*Cos[e+f*x])^(p+1)*(a+b*Sin[e+f*x])^m*Sin[e+f*x]/(f*g*(p+1)) + 
  1/(g^2*(p+1))*Int[(g*Cos[e+f*x])^(p+2)*(a+b*Sin[e+f*x])^(m-1)*(a*(p+2)+b*(m+p+2)*Sin[e+f*x]),x] /;
FreeQ[{a,b,e,f,g},x] && NeQ[a^2-b^2,0] && LtQ[0,m,1] && LtQ[p,-1] && (IntegersQ[2*m,2*p] || IntegerQ[m])

2:  ∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m)dx  when (a^2)-(b^2)≠0 ∧ m>1 ∧ p<-1

Derivation: Nondegenerate sine recurrence 3a with c->0,d->1,A->0,B->a,C->b,m->m-1,n->-1

Rule: If  (a^2)-(b^2)≠0 ∧ m>1 ∧ p<-1, then

∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m)dx  ⟶  
-(((((g Cos[e+f x]))^(p+1))(((a+b Sin[e+f x]))^(m-1))(b+a Sin[e+f x]))/(f g (p+1)))+
(1/((g^2) (p+1)))∫(((g Cos[e+f x]))^(p+2)) (((a+b Sin[e+f x]))^(m-2)) ((b^2) (m-1)+(a^2) (p+2)+a b (m+p+1) Sin[e+f x])dx

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(a_+b_.*sin[e_.+f_.*x_])^m_,x_Symbol] :=
  -(g*Cos[e+f*x])^(p+1)*(a+b*Sin[e+f*x])^(m-1)*(b+a*Sin[e+f*x])/(f*g*(p+1)) + 
  1/(g^2*(p+1))*Int[(g*Cos[e+f*x])^(p+2)*(a+b*Sin[e+f*x])^(m-2)*(b^2*(m-1)+a^2*(p+2)+a*b*(m+p+1)*Sin[e+f*x]),x] /;
FreeQ[{a,b,e,f,g},x] && NeQ[a^2-b^2,0] && GtQ[m,1] && LtQ[p,-1] && (IntegersQ[2*m,2*p] || IntegerQ[m])

2:  ∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m)dx  when (a^2)-(b^2)≠0 ∧ m>1 ∧ m+p≠0

Derivation: Nondegenerate sine recurrence 1b with c->0,d->1,A->0,B->a,C->b,m->m-1,n->-1

Rule: If  (a^2)-(b^2)≠0 ∧ m>1 ∧ m+p≠0, then

∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m)dx  ⟶  
-((b (((g Cos[e+f x]))^(p+1)) (((a+b Sin[e+f x]))^(m-1)))/(f g (m+p)))+
(1/(m+p))∫(((g Cos[e+f x]))^p)(((a+b Sin[e+f x]))^(m-2))((b^2) (m-1)+(a^2) (m+p)+a b (2 m+p-1) Sin[e+f x])dx

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(a_+b_.*sin[e_.+f_.*x_])^m_,x_Symbol] :=
  -b*(g*Cos[e+f*x])^(p+1)*(a+b*Sin[e+f*x])^(m-1)/(f*g*(m+p)) + 
  1/(m+p)*Int[(g*Cos[e+f*x])^p*(a+b*Sin[e+f*x])^(m-2)*(b^2*(m-1)+a^2*(m+p)+a*b*(2*m+p-1)*Sin[e+f*x]),x] /;
FreeQ[{a,b,e,f,g,p},x] && NeQ[a^2-b^2,0] && GtQ[m,1] && NeQ[m+p,0] && (IntegersQ[2*m,2*p] || IntegerQ[m])

2.  ∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m)dx  when  (a^2)-(b^2)≠0 ∧ m<-1

1:  ∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m)dx  when (a^2)-(b^2)≠0 ∧ m<-1 ∧ p>1

Derivation: Nondegenerate sine recurrence 2a with c->0,d->1,A->0,B->1,C->0,n->-1

Derivation: Integration by parts

Basis: Cos[e+f x] (((a+b Sin[e+f x]))^n)==(∂_x)((((a+b Sin[e+f x]))^(n+1))/(b f (n+1)))

Rule: If  (a^2)-(b^2)≠0 ∧ m<-1 ∧ p>1, then

∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m)dx  ⟶  
((g (((g Cos[e+f x]))^(p-1)) (((a+b Sin[e+f x]))^(m+1)))/(b f (m+1)))+(((g^2)(p-1))/(b (m+1)))∫(((g Cos[e+f x]))^(p-2))(((a+b Sin[e+f x]))^(m+1))Sin[e+f x]dx

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(a_+b_.*sin[e_.+f_.*x_])^m_,x_Symbol] :=
  g*(g*Cos[e+f*x])^(p-1)*(a+b*Sin[e+f*x])^(m+1)/(b*f*(m+1)) + 
  g^2*(p-1)/(b*(m+1))*Int[(g*Cos[e+f*x])^(p-2)*(a+b*Sin[e+f*x])^(m+1)*Sin[e+f*x],x] /;
FreeQ[{a,b,e,f,g},x] && NeQ[a^2-b^2,0] && LtQ[m,-1] && GtQ[p,1] && IntegersQ[2*m,2*p]

2:  ∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m)dx  when (a^2)-(b^2)≠0 ∧ m<-1

Derivation: Nondegenerate sine recurrence 1a with c->1,d->0,A->1,B->0,C->0

Derivation: Nondegenerate sine recurrence 1c with c->1,d->0,A->1,B->0,C->0

Derivation: Nondegenerate sine recurrence 1c with c->0,d->1,A->0,B->1,C->0,n->-1

Rule: If  (a^2)-(b^2)≠0 ∧ m<-1, then

∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m)dx  ⟶  
-((b(((g Cos[e+f x]))^(p+1))(((a+b Sin[e+f x]))^(m+1)))/(f g((a^2)-(b^2))(m+1)))+(1/(((a^2)-(b^2))(m+1)))∫(((g Cos[e+f x]))^p)(((a+b Sin[e+f x]))^(m+1)) (a (m+1)-b(m+p+2) Sin[e+f x])dx

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(a_+b_.*sin[e_.+f_.*x_])^m_,x_Symbol] :=
  -b*(g*Cos[e+f*x])^(p+1)*(a+b*Sin[e+f*x])^(m+1)/(f*g*(a^2-b^2)*(m+1)) + 
  1/((a^2-b^2)*(m+1))*Int[(g*Cos[e+f*x])^p*(a+b*Sin[e+f*x])^(m+1)*(a*(m+1)-b*(m+p+2)*Sin[e+f*x]),x] /;
FreeQ[{a,b,e,f,g,p},x] && NeQ[a^2-b^2,0] && LtQ[m,-1] && IntegersQ[2*m,2*p]

3:  ∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m)dx  when (a^2)-(b^2)≠0 ∧ p>1 ∧ m+p≠0

Derivation: Nondegenerate sine recurrence 2a with c->0,d->1,A->0,B->a,C->b,m->m-1,n->-1

Derivation: Nondegenerate sine recurrence 2b with c->0,d->1,A->0,B->1,C->0,n->-1

Rule: If  (a^2)-(b^2)≠0 ∧ p>1 ∧ m+p≠0, then

∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m)dx  ⟶  
((g (((g Cos[e+f x]))^(p-1)) (((a+b Sin[e+f x]))^(m+1)))/(b f (m+p)))+(((g^2) (p-1))/(b (m+p)))∫(((g Cos[e+f x]))^(p-2)) (((a+b Sin[e+f x]))^m) (b+a Sin[e+f x])dx

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(a_+b_.*sin[e_.+f_.*x_])^m_,x_Symbol] :=
  g*(g*Cos[e+f*x])^(p-1)*(a+b*Sin[e+f*x])^(m+1)/(b*f*(m+p)) + 
  g^2*(p-1)/(b*(m+p))*Int[(g*Cos[e+f*x])^(p-2)*(a+b*Sin[e+f*x])^m*(b+a*Sin[e+f*x]),x] /;
FreeQ[{a,b,e,f,g,m},x] && NeQ[a^2-b^2,0] && GtQ[p,1] && NeQ[m+p,0] && IntegersQ[2*m,2*p]

4:  ∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m)dx  when (a^2)-(b^2)≠0 ∧ p<-1

Derivation: Nondegenerate sine recurrence 3b with c->1,d->0,A->1,B->0,C->0

Derivation: Nondegenerate sine recurrence 3b with c->0,d->1,A->0,B->1,C->0,n->-1

Rule: If  (a^2)-(b^2)≠0 ∧ p<-1, then

∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m)dx  ⟶  
(((((g Cos[e+f x]))^(p+1)) (((a+b Sin[e+f x]))^(m+1)) (b-a Sin[e+f x]))/(f g((a^2)-(b^2))(p+1)))+
(1/((g^2)((a^2)-(b^2))(p+1)))∫(((g Cos[e+f x]))^(p+2)) (((a+b Sin[e+f x]))^m) ((a^2) (p+2)-(b^2) (m+p+2)+a b(m+p+3) Sin[e+f x])dx

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(a_+b_.*sin[e_.+f_.*x_])^m_,x_Symbol] :=
  (g*Cos[e+f*x])^(p+1)*(a+b*Sin[e+f*x])^(m+1)*(b-a*Sin[e+f*x])/(f*g*(a^2-b^2)*(p+1)) + 
  1/(g^2*(a^2-b^2)*(p+1))*Int[(g*Cos[e+f*x])^(p+2)*(a+b*Sin[e+f*x])^m*(a^2*(p+2)-b^2*(m+p+2)+a*b*(m+p+3)*Sin[e+f*x]),x] /;
FreeQ[{a,b,e,f,g,m},x] && NeQ[a^2-b^2,0] && LtQ[p,-1] && IntegersQ[2*m,2*p]

5.  ∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m)dx  when  (a^2)-(b^2)≠0 ∧ m+p∈(SuperMinus[ℤ])

1.  ∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m)dx  when  (a^2)-(b^2)≠0 ∧ m+p+1==0

1:  ∫(1/((Sqrt[g Cos[e+f x]]) (Sqrt[a+b Sin[e+f x]])))dx  when (a^2)-(b^2)≠0

Derivation: Piecewise constant extraction and integration by substitution

Basis: (∂_x)(( (Sqrt[g Cos[e+f x]])  (Sqrt[((a+b Sin[e+f x])/((a-b) (1-Sin[e+f x])))]))/( (Sqrt[a+b Sin[e+f x]]) (Sqrt[((1+Cos[e+f x]+Sin[e+f x])/(1+Cos[e+f x]-Sin[e+f x]))])))==0

Basis: ((Sqrt[((a+b Sin[e+f x])/((a-b) (1-Sin[e+f x])))])/((a+b Sin[e+f x]) (Sqrt[((1+Cos[e+f x]+Sin[e+f x])/(1+Cos[e+f x]-Sin[e+f x]))])))==((2 (Sqrt[2]))/((a-b) f)) Subst[(1/(Sqrt[1+(((a+b) (x^4))/(a-b))])),x,(Sqrt[((1+Cos[e+f x]+Sin[e+f x])/(1+Cos[e+f x]-Sin[e+f x]))])] (∂_x)(Sqrt[((1+Cos[e+f x]+Sin[e+f x])/(1+Cos[e+f x]-Sin[e+f x]))])

Rule: If  (a^2)-(b^2)≠0, then

∫(1/((Sqrt[g Cos[e+f x]]) (Sqrt[a+b Sin[e+f x]])))dx  ⟶  

(((a-b) (Sqrt[g Cos[e+f x]])  (Sqrt[((a+b Sin[e+f x])/((a-b) (1-Sin[e+f x])))]))/( g (Sqrt[a+b Sin[e+f x]]) (Sqrt[((1+Cos[e+f x]+Sin[e+f x])/(1+Cos[e+f x]-Sin[e+f x]))]))) ∫((Sqrt[((a+b Sin[e+f x])/((a-b) (1-Sin[e+f x])))])/((a+b Sin[e+f x]) (Sqrt[((1+Cos[e+f x]+Sin[e+f x])/(1+Cos[e+f x]-Sin[e+f x]))])))dx  ⟶  

((2 (Sqrt[2]) (Sqrt[g Cos[e+f x]])  (Sqrt[((a+b Sin[e+f x])/((a-b) (1-Sin[e+f x])))]))/(f g (Sqrt[a+b Sin[e+f x]]) (Sqrt[((1+Cos[e+f x]+Sin[e+f x])/(1+Cos[e+f x]-Sin[e+f x]))]))) Subst[∫(1/(Sqrt[1+(((a+b) (x^4))/(a-b))]))dx,x,(Sqrt[((1+Cos[e+f x]+Sin[e+f x])/(1+Cos[e+f x]-Sin[e+f x]))])]

Program code:

Int[1/(Sqrt[g_.*cos[e_.+f_.*x_]]*Sqrt[a_+b_.*sin[e_.+f_.*x_]]),x_Symbol] :=
  2*Sqrt[2]*Sqrt[g*Cos[e+f*x]]*Sqrt[(a+b*Sin[e+f*x])/((a-b)*(1-Sin[e+f*x]))]/
   (f*g*Sqrt[a+b*Sin[e+f*x]]*Sqrt[(1+Cos[e+f*x]+Sin[e+f*x])/(1+Cos[e+f*x]-Sin[e+f*x])])*
   Subst[Int[1/Sqrt[1+(a+b)*x^4/(a-b)],x],x,Sqrt[(1+Cos[e+f*x]+Sin[e+f*x])/(1+Cos[e+f*x]-Sin[e+f*x])]] /;
FreeQ[{a,b,e,f,g},x] && NeQ[a^2-b^2,0]

2:  ∫(((g Cos[e+f x]))^p)(((a+b Sin[e+f x]))^m)dx  when (a^2)-(b^2)≠0 ∧ m+p+1==0

Derivation: Integration by substitution

Rule: If  (a^2)-(b^2)≠0 ∧ m+p+1==0, then

∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m)dx  ⟶  
((g (((g Cos[e+f x]))^(p-1)) (1-Sin[e+f x]) (((a+b Sin[e+f x]))^(m+1))(((-(((a-b) (1-Sin[e+f x]))/((a+b) (1+Sin[e+f x])))))^(m/2)))/(f(a+b) (m+1))) Hypergeometric2F1[m+1,(m/2)+1,m+2,((2 (a+b Sin[e+f x]))/((a+b) (1+Sin[e+f x])))]

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(a_+b_.*sin[e_.+f_.*x_])^m_,x_Symbol] :=
  g*(g*Cos[e+f*x])^(p-1)*(1-Sin[e+f*x])*(a+b*Sin[e+f*x])^(m+1)*(-(a-b)*(1-Sin[e+f*x])/((a+b)*(1+Sin[e+f*x])))^(m/2)/
    (f*(a+b)*(m+1))*
    Hypergeometric2F1[m+1,m/2+1,m+2,2*(a+b*Sin[e+f*x])/((a+b)*(1+Sin[e+f*x]))] /;
FreeQ[{a,b,e,f,g,m,p},x] && NeQ[a^2-b^2,0] && EqQ[m+p+1,0]

2:  ∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m)dx  when (a^2)-(b^2)≠0 ∧ m+p+2==0

Rule: If  (a^2)-(b^2)≠0 ∧ m+p+2==0, then

∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m)dx  ⟶  
(((((g Cos[e+f x]))^(p+1)) (((a+b Sin[e+f x]))^(m+1)))/(f g (a-b) (p+1)))+(a/((g^2) (a-b)))∫(((((g Cos[e+f x]))^(p+2)) (((a+b Sin[e+f x]))^m))/(1-Sin[e+f x]))dx

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(a_+b_.*sin[e_.+f_.*x_])^m_,x_Symbol] :=
  (g*Cos[e+f*x])^(p+1)*(a+b*Sin[e+f*x])^(m+1)/(f*g*(a-b)*(p+1)) + 
  a/(g^2*(a-b))*Int[(g*Cos[e+f*x])^(p+2)*(a+b*Sin[e+f*x])^m/(1-Sin[e+f*x]),x] /;
FreeQ[{a,b,e,f,g,m,p},x] && NeQ[a^2-b^2,0] && EqQ[m+p+2,0]

3:  ∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m)dx  when (a^2)-(b^2)≠0 ∧ m+p+2∈(SuperMinus[ℤ])

Rule: If  (a^2)-(b^2)≠0 ∧ m+p+2∈(SuperMinus[ℤ]), then

∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m)dx  ⟶  
(((((g Cos[e+f x]))^(p+1)) (((a+b Sin[e+f x]))^(m+1)))/(f g (a-b) (p+1)))-
((b (m+p+2))/((g^2) (a-b) (p+1)))∫(((g Cos[e+f x]))^(p+2)) (((a+b Sin[e+f x]))^m)dx+(a/((g^2) (a-b)))∫(((((g Cos[e+f x]))^(p+2)) (((a+b Sin[e+f x]))^m))/(1-Sin[e+f x]))dx

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(a_+b_.*sin[e_.+f_.*x_])^m_,x_Symbol] :=
  (g*Cos[e+f*x])^(p+1)*(a+b*Sin[e+f*x])^(m+1)/(f*g*(a-b)*(p+1)) - 
  b*(m+p+2)/(g^2*(a-b)*(p+1))*Int[(g*Cos[e+f*x])^(p+2)*(a+b*Sin[e+f*x])^m,x] + 
  a/(g^2*(a-b))*Int[(g*Cos[e+f*x])^(p+2)*(a+b*Sin[e+f*x])^m/(1-Sin[e+f*x]),x] /;
FreeQ[{a,b,e,f,g,m,p},x] && NeQ[a^2-b^2,0] && ILtQ[m+p+2,0]

6:  ∫((Sqrt[g Cos[e+f x]])/(a+b Sin[e+f x]))dx  when (a^2)-(b^2)≠0

Derivation: Algebraic expansion and integration by substitution

Basis: (1/(a+b Sin[z]))==((a-b Sin[z])/((a^2)-(b^2) ((Sin[z])^2)))==(a/((a^2)-(b^2)+(b^2) ((Cos[z])^2)))-((b Sin[z])/((a^2)-(b^2)+(b^2) ((Cos[z])^2)))

Basis: Let q=(Sqrt[-(a^2)+(b^2)]), then ((Sqrt[g Cos[z]])/((a^2)-(b^2)+(b^2) ((Cos[z])^2)))==(g/(2b (Sqrt[g Cos[z]]) (q+b Cos[z])))-(g/(2 b (Sqrt[g Cos[z]]) (q-b  Cos[z])))

Basis: Sin[e+f x] F[g Cos[e+f x]]==-(1/(f g)) Subst[F[x],x,g Cos[e+f x]] (∂_x)(g Cos[e+f x])

Rule: If  (a^2)-(b^2)≠0, let q=(Sqrt[-(a^2)+(b^2)]), then

∫((Sqrt[g Cos[e+f x]])/(a+b Sin[e+f x]))dx  ⟶  a∫((Sqrt[g Cos[e+f x]])/((a^2)-(b^2)+(b^2) ((Cos[e+f x])^2)))dx-b∫((Sin[e+f x] (Sqrt[g Cos[e+f x]]))/((a^2)-(b^2)+(b^2) ((Cos[e+f x])^2)))dx
  
⟶  ((a g)/(2 b))∫(1/((Sqrt[g Cos[e+f x]]) (q+b Cos[e+f x])))dx-((a g)/(2 b))∫(1/((Sqrt[g Cos[e+f x]]) (q-b Cos[e+f x])))dx+((b g)/f) Subst[∫((Sqrt[x])/((g^2)((a^2)-(b^2))+(b^2) (x^2)))dx,x,g Cos[e+f x]]

Program code:

Int[Sqrt[g_.*cos[e_.+f_.*x_]]/(a_+b_.*sin[e_.+f_.*x_]),x_Symbol] :=
  With[{q=Rt[-a^2+b^2,2]},
  a*g/(2*b)*Int[1/(Sqrt[g*Cos[e+f*x]]*(q+b*Cos[e+f*x])),x] - 
  a*g/(2*b)*Int[1/(Sqrt[g*Cos[e+f*x]]*(q-b*Cos[e+f*x])),x] + 
  b*g/f*Subst[Int[Sqrt[x]/(g^2*(a^2-b^2)+b^2*x^2),x],x,g*Cos[e+f*x]]] /;
FreeQ[{a,b,e,f,g},x] && NeQ[a^2-b^2,0]

7:  ∫(1/((Sqrt[g Cos[e+f x]])(a+b Sin[e+f x])))dx  when (a^2)-(b^2)≠0

Derivation: Algebraic expansion and integration by substitution

Basis: (1/(a+b Sin[z]))==((a-b Sin[z])/((a^2)-(b^2) ((Sin[z])^2)))==(a/((a^2)-(b^2)+(b^2) ((Cos[z])^2)))-((b Sin[z])/((a^2)-(b^2)+(b^2) ((Cos[z])^2)))

Basis: Let q=(Sqrt[-(a^2)+(b^2)]), then (1/((a^2)-(b^2)+(b^2) ((Cos[z])^2)))==-(1/(2 q (q+b Cos[z])))-(1/(2 q (q-b Cos[z])))

Basis: Sin[e+f x] F[g Cos[e+f x]]==-(1/(f g)) Subst[F[x],x,g Cos[e+f x]] (∂_x)(g Cos[e+f x])

Rule: If  (a^2)-(b^2)≠0, let q=(Sqrt[-(a^2)+(b^2)]), then

∫(1/((Sqrt[g Cos[e+f x]])(a+b Sin[e+f x])))dx  ⟶  a∫(1/((Sqrt[g Cos[e+f x]])((a^2)-(b^2)+(b^2) ((Cos[e+f x])^2))))dx-b∫((Sin[e+f x])/((Sqrt[g Cos[e+f x]])((a^2)-(b^2)+(b^2) ((Cos[e+f x])^2))))dx
  
⟶  -(a/(2 q))∫(1/((Sqrt[g Cos[e+f x]]) (q+b Cos[e+f x])))dx-(a/(2 q))∫(1/((Sqrt[g Cos[e+f x]]) (q-b Cos[e+f x])))dx+((b g)/f) Subst[∫(1/((Sqrt[x]) ((g^2)((a^2)-(b^2))+(b^2) (x^2))))dx,x,g Cos[e+f x]]

Program code:

Int[1/(Sqrt[g_.*cos[e_.+f_.*x_]]*(a_+b_.*sin[e_.+f_.*x_])),x_Symbol] :=
  With[{q=Rt[-a^2+b^2,2]},
  -a/(2*q)*Int[1/(Sqrt[g*Cos[e+f*x]]*(q+b*Cos[e+f*x])),x] - 
  a/(2*q)*Int[1/(Sqrt[g*Cos[e+f*x]]*(q-b*Cos[e+f*x])),x] + 
  b*g/f*Subst[Int[1/(Sqrt[x]*(g^2*(a^2-b^2)+b^2*x^2)),x],x,g*Cos[e+f*x]]] /;
FreeQ[{a,b,e,f,g},x] && NeQ[a^2-b^2,0]

8.  ∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m)dx  when  (a^2)-(b^2)≠0 ∧ m∉(SuperPlus[ℤ])

1:  ∫(((g Cos[e+f x]))^p)(((a+b Sin[e+f x]))^m)dx  when (a^2)-(b^2)≠0 ∧ m∈(SuperMinus[ℤ])∧ m+p+1∉(SuperPlus[ℤ])

Derivation: Integration by substitution

Rule: If  (a^2)-(b^2)≠0 ∧ m∈(SuperMinus[ℤ])∧ m+p+1∉(SuperPlus[ℤ]), then

∫(((g Cos[e+f x]))^p)(((a+b Sin[e+f x]))^m)dx  ⟶  
((g (((g Cos[e+f x]))^(p-1))(((a+b Sin[e+f x]))^(m+1)))/(b f (m+p)(((-((b (1-Sin[e+f x]))/(a+b Sin[e+f x]))))^((p-1)/2)) (((((b (1+Sin[e+f x]))/(a+b Sin[e+f x]))))^((p-1)/2))))AppellF1[-p-m,((1-p)/2),((1-p)/2),1-p-m,((a+b)/(a+b Sin[e+f x])),((a-b)/(a+b Sin[e+f x]))]

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(a_+b_.*sin[e_.+f_.*x_])^m_,x_Symbol] :=
  g*(g*Cos[e+f*x])^(p-1)*(a+b*Sin[e+f*x])^(m+1)/
    (b*f*(m+p)*(-b*(1-Sin[e+f*x])/(a+b*Sin[e+f*x]))^((p-1)/2)*(b*(1+Sin[e+f*x])/(a+b*Sin[e+f*x]))^((p-1)/2))*
  AppellF1[-p-m,(1-p)/2,(1-p)/2,1-p-m,(a+b)/(a+b*Sin[e+f*x]),(a-b)/(a+b*Sin[e+f*x])] /;
FreeQ[{a,b,e,f,g,p},x] && NeQ[a^2-b^2,0] && ILtQ[m,0] && Not[IGtQ[m+p+1,0]]

2:  ∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m)dx  when  (a^2)-(b^2)≠0 ∧ m∉(SuperPlus[ℤ])

Derivation: Piecewise constant extraction and integration by substitution

Basis: (∂_x)((((g Cos[e+f x]))^(p-1))/((((1-((a+b Sin[e+f x])/(a-b))))^((p-1)/2)) (((1-((a+b Sin[e+f x])/(a+b))))^((p-1)/2))))==0

Basis: Cos[e+f x]==(1/f)(∂_x)Sin[e+f x]

Rule: If  (a^2)-(b^2)≠0 ∧ m∉(SuperPlus[ℤ]), then

∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m)dx  ⟶  

((g (((g Cos[e+f x]))^(p-1)))/((((1-((a+b Sin[e+f x])/(a-b))))^((p-1)/2)) (((1-((a+b Sin[e+f x])/(a+b))))^((p-1)/2))))∫Cos[e+f x] (((-(b/(a-b))-((b Sin[e+f x])/(a-b))))^((p-1)/2)) ((((b/(a+b))-((b Sin[e+f x])/(a+b))))^((p-1)/2)) (((a+b Sin[e+f x]))^m)dx  ⟶  

((g (((g Cos[e+f x]))^(p-1)))/(f (((1-((a+b Sin[e+f x])/(a-b))))^((p-1)/2)) (((1-((a+b Sin[e+f x])/(a+b))))^((p-1)/2))))Subst[∫(((-(b/(a-b))-((b x)/(a-b))))^((p-1)/2)) ((((b/(a+b))-((b x)/(a+b))))^((p-1)/2)) (((a+b x))^m)dx,x,Sin[e+f x]]

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(a_+b_.*sin[e_.+f_.*x_])^m_,x_Symbol] :=
  g*(g*Cos[e+f*x])^(p-1)/(f*(1-(a+b*Sin[e+f*x])/(a-b))^((p-1)/2)*(1-(a+b*Sin[e+f*x])/(a+b))^((p-1)/2))*
    Subst[Int[(-b/(a-b)-b*x/(a-b))^((p-1)/2)*(b/(a+b)-b*x/(a+b))^((p-1)/2)*(a+b*x)^m,x],x,Sin[e+f*x]] /;
FreeQ[{a,b,e,f,g,m,p},x] && NeQ[a^2-b^2,0] && Not[IGtQ[m,0]]

Rules for integrands of the form (((g Sec[e+f x]))^p) (((a+b Sin[e+f x]))^m)

1:  ∫(((g Sec[e+f x]))^p) (((a+b Sin[e+f x]))^m)dx  when p∉ℤ

Derivation: Piecewise constant extraction

Basis: (∂_x)((((g Cos[e+f x]))^p) (((g Sec[e+f x]))^p))==0

Rule: If  p∉ℤ, then

∫(((g Sec[e+f x]))^p) (((a+b Sin[e+f x]))^m)dx  ⟶  (g^(2 IntPart[p])) (((g Cos[e+f x]))^(FracPart[p])) (((g Sec[e+f x]))^(FracPart[p]))∫((((a+b Sin[e+f x]))^m)/(((g Cos[e+f x]))^p))dx

Program code:

Int[(g_.*sec[e_.+f_.*x_])^p_*(a_+b_.*sin[e_.+f_.*x_])^m_.,x_Symbol] :=
  g^(2*IntPart[p])*(g*Cos[e+f*x])^FracPart[p]*(g*Sec[e+f*x])^FracPart[p]*Int[(a+b*Sin[e+f*x])^m/(g*Cos[e+f*x])^p,x] /;
FreeQ[{a,b,e,f,g,m,p},x] && Not[IntegerQ[p]]